<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<div th:insert="~{common/common::common}"/>
<head>
    <meta charset="UTF-8">
    <title>session_random_extract</title>
</head>
<body>
<div th:replace="~{common/leftnavbar::leftnav}"></div>
<div class="layui-body" style="padding-left:75px;">
    <div>
        <p style="text-align: left;font-size: 200%"><b>随机session列表展示</b></p>
        <p style="text-align: left;font-size: 120%">以下展示的是随机抽取的session信息</p>
    </div>
    <table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>
</div>
</body>
<script type="text/javascript">
    layui.use('table', function(){
        var table = layui.table, $ = layui.$;

        //方法级渲染
        var t = table.render({
            elem: '#LAY_table_user'
            ,url: '/re'
            ,parseData: function(res){ //res 即为原始返回的数据
                return {
                    "code": res.code,
                    "count": res.data.total,
                    "data": res.data.list
                };
            }
            ,cols: [
                [
                    {field:'sessionid', title: 'SessionID', width:300}
                    ,{field:'startTime', title: '事件发生时间', width:200}
                    ,{field:'searchKeywords', title: '搜索关键字', width:550}
                    ,{field:'clickCategoryIds', title: '商品品类ID'}
                ]
            ]
            ,id: 'testReload'
            ,page: true
            ,height: 'full-70'
        });
    });

    function accessfunc() {
        if (document.getElementById("access").getAttribute("class") == "layui-nav-item layui-nav-itemed") {
            document.getElementById("access").setAttribute("class", "layui-nav-item");
        } else {
            document.getElementById("access").setAttribute("class", "layui-nav-item layui-nav-itemed");
        }
    }

    function categoryfunc() {
        if (document.getElementById("category").getAttribute("class") == "layui-nav-item layui-nav-itemed") {
            document.getElementById("category").setAttribute("class", "layui-nav-item");
        } else {
            document.getElementById("category").setAttribute("class", "layui-nav-item layui-nav-itemed");
        }
    }
</script>
</html>